home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1998-02-12 | 5.9 KB | 201 lines | [ TEXT/MPS ]
; ; File: AppleScript.a ; ; Contains: AppleScript Specific Interfaces. ; ; Version: Technology: AppleScript 1.1 ; Release: Universal Interfaces 3.1 ; ; Copyright: © 1992-1998 by Apple Computer, Inc., all rights reserved ; ; Bugs?: Please include the the file and version information (from above) with ; the problem description. Developers belonging to one of the Apple ; developer programs can submit bug reports to: ; ; devsupport@apple.com ; ; IF &TYPE('__APPLESCRIPT__') = 'UNDEFINED' THEN __APPLESCRIPT__ SET 1 IF &TYPE('__ERRORS__') = 'UNDEFINED' THEN include 'Errors.a' ENDIF IF &TYPE('__APPLEEVENTS__') = 'UNDEFINED' THEN include 'AppleEvents.a' ENDIF IF &TYPE('__OSA__') = 'UNDEFINED' THEN include 'OSA.a' ENDIF IF &TYPE('__TEXTEDIT__') = 'UNDEFINED' THEN include 'TextEdit.a' ENDIF ; ************************************************************************** ; Types and Constants ;************************************************************************* ; ; The specific type for the AppleScript instance of the ; Open Scripting Architecture type. ; typeAppleScript EQU 'ascr' kAppleScriptSubtype EQU 'ascr' typeASStorage EQU 'ascr' ; ************************************************************************** ; Component Selectors ;************************************************************************* kASSelectInit EQU $1001 kASSelectSetSourceStyles EQU $1002 kASSelectGetSourceStyles EQU $1003 kASSelectGetSourceStyleNames EQU $1004 ; ************************************************************************** ; OSAGetScriptInfo Selectors ;************************************************************************* kASHasOpenHandler EQU 'hsod' ; ; This selector is used to query a context as to whether it contains ; a handler for the kAEOpenDocuments event. This allows "applets" to be ; distinguished from "droplets." OSAGetScriptInfo returns false if ; there is no kAEOpenDocuments handler, and returns the error value ; errOSAInvalidAccess if the input is not a context. ; ; ************************************************************************** ; Initialization ;************************************************************************* ; ; pascal OSAError ASInit(ComponentInstance scriptingComponent, long modeFlags, long minStackSize, long preferredStackSize, long maxStackSize, long minHeapSize, long preferredHeapSize, long maxHeapSize) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN Macro _ASInit move.l #$001C1001,-(sp) moveq #0,D0 dc.w $A82A EndM ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ASInit ENDIF ; ; ComponentCallNow(kASSelectInit, 28); ; This call can be used to explicitly initialize AppleScript. If it is ; not called, the a scripting size resource is looked for and used. If ; there is no scripting size resource, then the constants listed below ; are used. If at any stage (the init call, the size resource, the ; defaults) any of these parameters are zero, then parameters from the ; next stage are used. ModeFlags are not currently used. ; Errors: ; errOSASystemError initialization failed ; ; ; These values will be used if ASInit is not called explicitly, or if any ; of ASInit's parameters are zero: ; kASDefaultMinStackSize EQU 4096 kASDefaultPreferredStackSize EQU 16384 kASDefaultMaxStackSize EQU 16384 kASDefaultMinHeapSize EQU 4096 kASDefaultPreferredHeapSize EQU 16384 kASDefaultMaxHeapSize EQU 33554432 ; ************************************************************************** ; Source Styles ;************************************************************************* ; ; pascal OSAError ASSetSourceStyles(ComponentInstance scriptingComponent, STHandle sourceStyles) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN Macro _ASSetSourceStyles move.l #$00041002,-(sp) moveq #0,D0 dc.w $A82A EndM ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ASSetSourceStyles ENDIF ; ; ComponentCallNow(kASSelectSetSourceStyles, 4); ; Errors: ; errOSASystemError operation failed ; ; ; pascal OSAError ASGetSourceStyles(ComponentInstance scriptingComponent, STHandle *resultingSourceStyles) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN Macro _ASGetSourceStyles move.l #$00041003,-(sp) moveq #0,D0 dc.w $A82A EndM ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ASGetSourceStyles ENDIF ; ; ComponentCallNow(kASSelectGetSourceStyles, 4); ; Errors: ; errOSASystemError operation failed ; ; ; pascal OSAError ASGetSourceStyleNames(ComponentInstance scriptingComponent, long modeFlags, AEDescList *resultingSourceStyleNamesList) ; IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN Macro _ASGetSourceStyleNames move.l #$00081004,-(sp) moveq #0,D0 dc.w $A82A EndM ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN IMPORT_CFM_FUNCTION ASGetSourceStyleNames ENDIF ; ; ComponentCallNow(kASSelectGetSourceStyleNames, 8); ; This call returns an AEList of styled text descriptors the names of the ; source styles in the current dialect. The order of the names corresponds ; to the order of the source style constants, below. The style of each ; name is the same as the styles returned by ASGetSourceStyles. ; ; Errors: ; errOSASystemError operation failed ; ; ; Elements of STHandle correspond to following categories of tokens, and ; accessed through following index constants: ; kASSourceStyleUncompiledText EQU 0 kASSourceStyleNormalText EQU 1 kASSourceStyleLanguageKeyword EQU 2 kASSourceStyleApplicationKeyword EQU 3 kASSourceStyleComment EQU 4 kASSourceStyleLiteral EQU 5 kASSourceStyleUserSymbol EQU 6 kASSourceStyleObjectSpecifier EQU 7 kASNumberOfSourceStyles EQU 8 ENDIF ; __APPLESCRIPT__